package com.spzx.cart.api;

import com.spzx.cart.api.domain.CartInfo;
import com.spzx.cart.api.factory.RemoteCartFallBackFactory;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @author LOGIN
 * @title RemoteCartService
 * @create 2025/7/28 1:50
 * @description
 */
@FeignClient(
        value = ServiceNameConstants.CART_SERVICE,
        fallbackFactory =  RemoteCartFallBackFactory.class
)
public interface RemoteCartService {
    @GetMapping("/getCartCheckedList")
    R<List<CartInfo>> getCartCheckedList(
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source
    );
    @GetMapping("/deleteCartCheckedList")
    R<Boolean> deleteCartCheckedList(
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source
    );
    @Operation(summary = "更新用户购物车列表价格")
    @GetMapping("/updateCartPrice")
    R<Boolean> updateCartPrice(
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source
    );
}
